//导入mongoose
const mongoose = require('mongoose');

function collect() {
    let noteSchema = new mongoose.Schema({
        matter: {
            type: String,
            required:true//键值(必填项)
        },
        time: Date,
        type: String,
        money: Number,
        notes: String
    });
    return mongoose.model('notes', noteSchema);
}

// 暴漏
exports.collect = collect;